home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 1997 March
/
CHIP Mart 1997.iso
/
SurfCam
/
SURFCAM.Z
/
UNCL01.F02
< prev
next >
Wrap
Text File
|
1996-04-01
|
10KB
|
176 lines
$$ Fanuc 10T
$$ 2/1/96 Support for cutter comp.
$$ 2/1/96 Cancel Tool Offset, Spindle & Send Tool Home
$$ 2/2/96 G76 or G33 Threading using Relcom 1351
$$ 3/11/96 Check the Pprint or ID or OD
$$ 3/13/96 Added part number prompt
$$ 4/5/96 Added user defined comments
$$ PRINT/ON; XX = POSTF(24,1) $$ DIAGNOSTICS
REDEF/ON $$ ALLOW VARIABLES TO BE OVERWRITTEN
LASTT=-99 $$ LASTT IS USED FOR CHECKING TOOL NO.
COMPCD=40 $$ COMPCD IS USED FOR CUTTER COMP.
$$ VARIABLES FOR COMMENTS
RESERV/SCNOTE,11 $$ ASSIGN VARIABLES TO TRAP
SCNOTE(1)=TEXT/'SURFCAM TOOL'
SCNOTE(2)=TEXT/'MATERIAL'
SCNOTE(3)=TEXT/'NUM FLUTES'
SCNOTE(4)=TEXT/'TAPER ANGLE'
SCNOTE(5)=TEXT/'OFFSET FROM SURFACE'
SCNOTE(6)=TEXT/'PROGRAM UNITS'
SCNOTE(7)=TEXT/'PROGRAMMED TO'
SCNOTE(8)=TEXT/'TURRET NO.'
SCNOTE(9)=TEXT/'TIP RADIUS'
SCNOTE(10)=TEXT/'ORIENTATION'
SCNOTE(11)=TEXT/'DESCRIPTION'
$$ THIS MACRO CONVERTS LOWER CASE CHARACTERS TO UPPER CASE.
$$ AT TERMAC, UPCHAR CONTAINS UPPER CASE VERSION OF STRING PASSED ON CALL
UPRCAS=MACRO/CHARS $$ CHARS IS SYMBOLIC NAME OF STRING
UPCHAR=TEXT/CHARS $$ SET UPCHAR TO EQUAL THE UPPERCASE PPRINT
DO/UPPIT,KK=1,26 $$ LOOP 1 TO 26 (A TO Z)
LOWER1=TEXT/CONVS,(96+KK) $$ GET LOWER CASE A -> Z
UPPER1=TEXT/CONVS,(64+KK) $$ EQUIVALENT UPPER CASE A -> Z
UPCHAR=TEXT/MODIFY,UPCHAR,LOWER1,UPPER1,0 $$ CONVERT ALL LOWERS TO UPPERS
UPPIT) CONTIN $$ CAUSE REPETITION OF LOOP
TERMAC $$ TERMINATE MACRO
ODTHRD=TEXT/'ODTHREADING' $$ SET VARIABLE FOR ODTHREADING
IDTHRD=TEXT/'IDTHREADING' $$ SET VARIABLE FOR IDTHREADING
$$ <<<<<<<<<<<<<<<<<<<<< END OF INITIALIZATION AREA >>>>>>>>>>>>>>>>>>>>>>>>
CIMFIL/ON,PARTNO $$ TRAPS PARTNO STATEMENT
STRNG=TEXT/CLW $$ STORES THE CONTENTS INTO STRNG
STRNG=TEXT/OMIT,STRNG,1 $$ REMOVES ALL OF THE SPACES
CMPR=CMPRF(STRNG,(TEXT/' 0')) $$ COMPARES VALUE TO ZERO, 0=TRUE 1=FALSE
IF(CMPR.EQ.1)THEN $$ IF FALSE(1) THEN...
PROMPT=TEXT/'Enter program library number' $$ STORES THE DESIRED STRING TO PROMPT
DUMMY=FILEF(0,1,PROMPT) $$ OPEN FILE#0 AND WRITE TEXT STORED IN PROMPT
STRNG=TEXT/READ,0 $$ OVERWRITE STRING WITH THE USER(TERMINAL) INPUT
ENDIF $$ END TEST
PARTNO/STRNG $$ RESET THE PARTNO TO USER INPUT(STRING)
CIMFIL/OFF $$ CLOSE FIL
CIMFIL/ON,MACHIN $$ TRAPS MACHIN STATEMENT
DUMMY=POSTF(13) $$ SEND RECORD TO POST
SEQNO/OFF $$ TURNS SEQUENCE NUMBERS OFF
INSERT/'O',STRNG,'$' $$ INSERT O ADDRESS AND NEW PROGRAM #(STRING)
CIMFIL/OFF $$ CLOSE FIL
CIMFIL/ON,CUTCOM $$ TRAP CUTCOM(CUTTER COMP)
WRD4=POSTF(7,4) $$ ASSIGN THE CUTCOM TO WRD4
CASE/WRD4 $$ TEST FOR CUTTER COMP.
WHEN/(ICODEF(LEFT)) $$ CUTTER COMP LEFT
COMPCD=41 $$ SETS COMPCD EQUAL TO 41
WHEN/(ICODEF(RIGHT)) $$ CUTTER COMP RIGHT
COMPCD=42 $$ SETS COMPCD EQUAL TO 42
WHEN/(ICODEF(OFF)) $$ CUTTER COMP OFF
COMPCD=40 $$ SETS COMPCD EQUAL TO 40
ENDCAS $$ END TEST
IF(COMPCD.GE.41)THEN $$ CHECK IF COMP IS >OR = 41
REPEAT/OFF $$ TURN OFF THE REPEAT COMMAND
REPEAT/24,26,7,COMPCD,ALL $$ OUTPUT 24=X, 26=Z, 7=G(40,41,42)
ELSE $$ OR...
PREFUN/COMPCD $$ OUTPUT G41,G42,OR G40
ENDIF $$ END OF IF STATEMENT
CIMFIL/OFF $$ END ROUTINE
$$ HANDLING COMP AT END OF SEQUENCE
CIMFIL/ON,LOADTL $$ TRAP LOADTL(TOOLCHANGE)
$$ USED FOR TOOL & OFFSET NUMBERS
TNUM=POSTF(7,4) $$ ASSIGN THE TOOL NUMBER TO TNUM
TOFF=POSTF(7,6) $$ ASSIGN THE TOOL OFFSET TO TOFF
IF(TNUM.EQ.LASTT)THEN $$ CHECK IF TOOL NUMBER HAS CHANGED
SELECT/TOFF $$ MEANS ONLY OFFSET WAS CHANGED
ELSE $$ REAL INDEX (PREFORM A TOOLCHANGE)
IF(COMPCD.NE.40)PREFUN/40 $$ SETS THE CUTTER COMP TO OFF
COMPCD=40 $$ SET CUTTER COMP TO 40
IF(LASTT.NE.-99)THEN $$ CHECK IF THIS IS THE 1ST TOOL
SELECT/0,NEXT $$ WILL PUT OUT THE TCODE WITH 00 NEXT LINE
AUXFUN/5,NEXT $$ OUTPUTS THE M5 NEXT LINE
ENDIF $$ END OF IF STATEMENT
RAPID;GOHOME $$ SEND TOOL BACK TO HOME POSITION
TURRET/TNUM,TOFF,0,0 $$ CALL UP THE NEXT TOOL & OFFSET
LASTT=TNUM $$ SETTING LAST TOOL EQUAL TO TOOL NUMBER
ENDIF $$ END OF IF STATEMENT
$$SEQNO/ON $$ SEQUENCE NUMBERS
CIMFIL/OFF $$ END ROUTINE
$$ HANDLING COMP AT END
CIMFIL/ON,END $$ LOOKING FOR END
RSTL=POSTF(20) $$ SAVE END
SELECT/0,NEXT $$ WILL PUT OUT THE TCODE WITH 00 NEXT LINE
AUXFUN/5,NEXT $$ OUTPUTS THE M5 NEXT LINE
RAPID;GOHOME $$ SEND TOOL BACK TO HOME POSITION
RSTL=POSTF(21) $$ RESTORE
RSTL=POSTF(13) $$ SEND RECORD TO POST
CIMFIL/OFF $$ END ROUTINE
CIMFIL/ON,THREAD $$ TRAP FOR THREAD
CHKREL=POSTF(1,2,1351) $$ CHECK FOR CANNED CYCLE
IF(CHKREL.EQ.76)THEN $$ CHECK IF RELCOM FOR 1351 IS 76
X1=POSTF(7,5) $$ START POINT IN Z
Y1=POSTF(7,6) $$ START POINT IN X
Z1=POSTF(7,7) $$ VALUE IS NOT USED
X2=POSTF(7,9) $$ END POINT IN Z
Y2=POSTF(7,10) $$ END POINT IN X
Z2=POSTF(7,11) $$ VALUE IS NOT USED
LEAD=(POSTF(7,13)) $$ ALWAYS PITCH
LEAD=1/LEAD $$ ESTABLISH THE PITCH
PRCNT=POSTF(7,15) $$ PERCENTAGE USED FOR TOTAL DEPTH
TOTDPT=ABSF(POSTF(7,20)) $$ ABSOLUTE TOTAL DEPTH OF THREAD
MINDP=POSTF(7,17) $$ MIN DEPTH
LASTPS=POSTF(7,23) $$ AMOUNT OF SPRING PASSES
INFD=90-(POSTF(7,21)) $$ IN FIELD ANGLE
P2=PRCNT*TOTDPT $$ TOTAL DEPTH OF THREAD * PERCENTAGE
CLEAR=.1 $$ DEFINED CLEARANCE AMOUNT
IF(DRFLAG.NE.0)THEN $$ DIRECTION IS OD
CLEAR=(CLEAR*-1) $$ CHANGE OFFSET SIDE
ELSE $$ DIRECTION IS ID
TOTDPT=(TOTDPT*-1) $$ CHANGE DEPTH SIDE
ENDIF $$ END OF IF STATEMENT
YMUL=POSTF(1,2,1350) $$ GET RADIAL MULT
$$ G76 TYPE THREADING CYCLE
$$ G X Z $$ RAPID TO CLEARANCE POSITION FOR ID
POSTN/OUT,7,0,24,((Y2+CLEAR)*YMUL),26,X1
$$ X Z P Q R F G
POSTN/OUT,24,((Y2+TOTDPT)*YMUL),26,X2,16,P2,17,LASTPS,18,0,6,LEAD,7,76
$$ O Q R G
POSTN/OUT,15,(010000+INFD),17,MINDP,18,0,7,76
ELSE $$ OR, OUTPUT LONGHAND CODE
XX=POSTF(13) $$ NO CANNED CYCLE, G33 TYPE
ENDIF $$ END OF IF STATEMENT
CIMFIL/OFF $$ END ROUTINE
CIMFIL/ON,PPRINT $$ TRAP FOR THE PPRINTS
PPSTR=TEXT/CLW $$ 66 CHARACTERS OUT OF PPRINT STATMENT
CNT=0 $$ INITIALIZE COUNTER
CALL/UPRCAS,CHARS=PPSTR $$ CALL THE MACRO 'UPRCAS'
PPSTR=TEXT/UPCHAR $$ SET PPSTR TO UPPER CHARACTERS
DO/STRIP,JJ=1,11 $$ BEGINING DO LOOP
PP=INDXF(PPSTR,SCNOTE(JJ)) $$ LOOK FOR SUBSTRING MATCH IN COMMENT STRING
IF(PP.GE.1) THEN $$ IF COMMENT MATCHES THEN
CNT=CNT+PP $$ ADD PP VALUE TO CNT
ENDIF $$ END OF IF STATEMENT
STRIP) CONTIN $$ END OFf DO LOOP
IF(CNT.LT.1) THEN $$ CHECK THE COMMENTS
DISPLY/ON $$ IF NOT A SURFCAM COMMENT TURN ON DISPLAY
PPRINT/PPSTR $$ PRINT USER COMMENTS
ENDIF $$ END OF IF STATEMENT
PPSTR=TEXT/CLW $$ 66 CHARACTERS OUT OF PPRINT STATMENT
PPSTR=TEXT/OMIT,PPSTR,3 $$ THROW OUT ALL BLANKS
CALL/UPRCAS,CHARS=PPSTR $$ CALL THE MACRO 'UPRCAS'
PPSTR=TEXT/UPCHAR $$ SET PPSTR TO UPPER CHARACTERS
RADLOC=INDXF(PPSTR,IDTHRD) $$ INDEX TO PPRINT IDTHREADING
IF(RADLOC.NE.0)THEN $$ CHECK FOR PPRINT IDTHREADING
DRFLAG=1 $$ FLAG FOR IDTHREADING
ENDIF $$ END OF IF STATEMENT
RADLOC=INDXF(PPSTR,ODTHRD) $$ INDEX TO PPRINT ODTHREADING
IF(RADLOC.NE.0)THEN $$ CHECK FOR PPRINT ODTHREADING
DRFLAG=0 $$ FLAG FOR ODTHREADING
ENDIF $$ END OF IF STATEMENT
CIMFIL/OFF $$ END ROUTINE
FINI